const mongoose = require('mongoose')
const schema = new mongoose.Schema({
    title: {//标题
        type: String,
        required: true,
        trim: true
    },
    type_id: {
        type: Number,
        required: true,
        // 0、其他 1、jquery 2、javascript 3、vue 4、uniapp 
    },
    content: {
        type: String,
        require: true,
        trim: true
    }
}, {
    timestamps: {
        createdAt: 'created',
        updatedAt: 'updated'
    }
});//更新时间和修改时间
module.exports = mongoose.model('Note', schema, 'notes')